package com.hnas.trade.service;

import java.util.List;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.hnas.eCard.orm.CommoditOrderDetail;
import com.hnas.eCard.service.dto.DTOCommoditDetail;
import com.hnas.eastsquare.orm.SediBalanceChangeRecord;
import com.hnas.trade.dto.DTOOrder;
import com.hnas.trade.dto.DTOOrderDetail;
import com.hnas.trade.dto.DTOPosOrder;
import com.hnas.trade.dto.intf.CreateOrderDetailBean;
import com.hnas.trade.orm.Order;

public interface OrderService {

	Order saveOrUpdate(DTOOrder dto) throws Exception;//创建(修改)订单

	DTOOrder getByOrderNo(String orderNo);

	String getOrderInfoByQRCode(String qrCode);

	//String notifyPaymentStatus(String orderNo, String tranStatus, String tradeSno);
	
	DTOOrder getBySwiftNumber(String swiftNumber);
	
	DTOPosOrder createPosOrder(DTOOrder dto, DTOOrderDetail mrch, DTOOrderDetail vip, List<DTOOrderDetail> couponList) throws Exception;
	
	void updateStatusByOrderNo(String orderNo,String status);

	String recharge(String order_no) throws JsonProcessingException;

	void updateOrderStatus(String orderNo, String status);
	
	Order saveQrcode(DTOOrder orderDto,List<CreateOrderDetailBean> beans) throws Exception;

	Order updateOrder(DTOOrder order, String status)  throws Exception ;

	List<Order> getEastSquarList(String date);
	
	int getEastSquareCount(String date);
	
	String createEastSquareOrder(DTOOrder dto,DTOOrderDetail orderDetail,SediBalanceChangeRecord changeRecord);

	int getCountByActivity(String mrchId, String termNo, String id, String dateStr);

	int getCountByAccno(String accno, String activityId,String itemId, String dateStr);

	/**
	 * 根据账户id和卡号查询记账的订单
	 * @param accId 账户id
	 * @param cardNo 卡号
	 * @return
	 */
	List<DTOOrder> listAccountOrder(String accId, String cardNo);
	/**
	 * 修改订单并交易记录
	 * @param dto
	 * @return
	 * @throws Exception
	 */
	Order updateOrderSaveTradeRecord(DTOOrder dto) throws Exception;//创建(修改)订单

	boolean createCommoditOrder(DTOOrder orderDto, List<DTOCommoditDetail> detailList) throws Exception;

}
